package com.copa.l2027;

/**
 * @author copa
 * @createDate 2022-12-27 9:07
 * @function 贪心法
 */
public class Test2 {

    public int minimumMoves(String s) {
        int total = s.length();
        int result = 0;
        for (int i = 0; i < total; i++) {
            if (s.charAt(i) == 'X') {
                result++;
                i += 2;
            }
        }
        return result;
    }

    public static void main(String[] args) {
        String s = "XXOXXXOO";
        System.out.println(new Test2().minimumMoves(s));
    }
}
